package cn.webestar.scms.user.api.dto.SysResource;

import cn.webestar.scms.commons.api.UpdateBody;
import cn.webestar.scms.user.entity.SysResource;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

@Data
@Schema(description = "SysResourceUpdateDTO")
public class SysResourceUpdateDTO extends UpdateBody {

    private Long id;

    @Schema(description = "父编码")
    private String pcode;

    @Schema(description = "编码")
    private String code;

    @Schema(description = "URL")
    private String url;

    @Schema(description = "名称")
    private String name;

    @Schema(description = "资源类型，1：目录、菜单，2：页面，3：接口")
    private Integer type;

    @Schema(description = "备注")
    private String remark;

    @Override
    public Long getId() {
        return id;
    }

    @Override
    public SysResource toDO() {
        SysResource o = new SysResource();
        o.setId(id);
        o.setPcode(pcode);
        o.setCode(code);
        o.setUrl(url);
        o.setName(name);
        o.setType(type);
        o.setRemark(remark);
        return o;
    }

}
